{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Sun Angles"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<i>© Von P. Walden, Washington State University</i>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Calculates the diurnal cycle for a given longitude, latitude and day of year."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import ephem\n",
    "from datetime import datetime, timedelta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "site = ephem.Observer()\n",
    "\n",
    "# INPUT THE LONGITUDE AND LATITUDE MANUALLY\n",
    "#site.lon, site.lat = '-117.', '+46.'      # Moscow-Pullman\n",
    "#site.lon, site.lat = '0.', '72.5'      # Summit Station, Greenland\n",
    "site.lon, site.lat = '0.', '-80.'       # Antarctica"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# USE THE CURRENT DAY\n",
    "#utc = datetime.utcnow()\n",
    "\n",
    "# INPUT THE DAY MANUALLY\n",
    "utc = datetime(2014,2,28)\n",
    "\n",
    "site.date = utc.strftime('%Y/%m/%d')\n",
    "utcday    = datetime(utc.year, utc.month, utc.day)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "sun = ephem.Sun()\n",
    "sun.compute(site)\n",
    "time = array([])\n",
    "alt  = array([])\n",
    "azi  = array([])\n",
    "for hour in range(48):                                    # At 30-minute resolution        \n",
    "    time = append(time,utcday + timedelta(hour/48.))\n",
    "    alt  = append(alt,sun.alt)\n",
    "    azi  = append(azi,sun.az)\n",
    "    \n",
    "    site.date += ephem.minute * 30.\n",
    "    sun.compute(site)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0cAAAI4CAYAAAChuZIjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xuc3WldH/DPdwjoKMjEG8jasuNWwIKw9VZbJ8Ou8QJW\nBLW14m4bsPV+a20bjXETyDYMTluqtloVkEZZqi2tAl7Q7UqcE+1WARHwAhYSleWiYrIgHpHlPP3j\nnEkms5NJspmZ8ztn3u/X67wy5/f7nd88Z57MnPM5v+f5PtVaCwAAwG43M+4GAAAAdIFwBAAAEOEI\nAAAgiXAEAACQRDgCAABIIhwBAAAkEY4AAACSCEcAU6+qHlJVL6qqM1V1b1W9vqqesu6Y/VX1e1X1\nF1V1V1X9zTX7bqqqX6mqc1X19k2+z5OralBVxy7TnkePzveBqvrdqtq/Zt+XVFWvqs5W1Tur6seq\n6qM3OddGxz90zf69VfXTVfVnVfUnVfWTa/dvcL5L/hxG+79vdK4/rarnP9DnOdr/NaM+eX9V/a+q\nmtvkXA+pqh8f9d87q+pfrtt/Y1W9dvS9frOqnrRZ2wDYmHAEMP32JPmjJPtaaw9PcluS/776xr+q\nPi7J/0xyOMnHJnldkp9e8/gPJHlxkn99qW9QVXuSfH+Su6+gPf9t9D0+Nsn3Jnn5qA1J8jFJbk/y\nSUk+LcknJ/l3m5xro+OX1+w/nuThSR6d5IYkj0zynEs8h01/DlX1DUm+LMmnJ3likqdV1dc/kOdZ\nVY9P8iNJbknyiCT9JP9lk3M9d9T+v5Hk85McrKovGp3rwUl+NslPJJkb/fuKUZ8AcBWqtTbuNgCw\nw6rqt5M8p7X2M1X1d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PmD1tofttY+\nlOSnkjx9zG2aOqqZAACwm+0ZdwOu0HVJ/njN/XdkGJjYQvv2LebYsbtUMwEAYFealHDEDtm3b1Hx\nBQAAzjt9+nRuu+223HPPPbnuuuty++23Z35+ftzN2h6ttc7fknxuklevuf/dSb5rg+PaRrejR4+2\njRw9etTxjne84x3veMc73vGOd/wljn/729/ebrjhhg2PmYT2t9baa17zmnb06NF29OjR9uQnP7kl\nae0SuWMiSnlX1YOSvCXJ/iTvSvIbSZ7ZWvu9dce1SXg+AAAwCW699dbccccd99t+yy235KUvfekY\nWnTtJr6Ud2vtw0m+NckvJ/mdJD+1PhgxvOR566235uabb86tt96a06dPj7tJAABMsHvuuWfD7e98\n5zt3uCU7Y2LmHLXWXp3kseNuR1edPn06X/iFX5i3ve1t57fdfffdufPOO6d3TCgAANvquuuu23D7\nox71qB1uyc6YiCtHXN5tt912UTBKkre97W257bbbxtQiAAAm3e23354bbrjhom033HBDbr/99jG1\naHtNzJUjNrfbLnkCALD95ufnc+edd+a2227LO9/5zjzqUY+a6mp1wtGU2G2XPAEA2Bnz8/MTW3zh\nak1EtbortZur1W005+iGG24w5wgAANbYrFqdcDRFVhfo2g2XPAEA4IEQjgAAgLFZ/RD/nnvuyXXX\nXTfWD/GFownRpf80AACwFbo2/UM4mgBd+08DAABb4dZbb80dd9xxv+233HLLWAo9bBaOrHPUEdYp\nAgBgGk3SkjPCUUdM0n8aAAC4UpO05Ixw1BGT9J8GAACu1O23354bbrjhom033HBDbr/99jG16NLM\nOdoi11pMwZwjAACmVZeWnFGQYZttVbDp0n8aAADokq2q7CwcbbOuVeAAAIBpspWjrHZVtbpbb701\np0+fvurHnT59Orfeemtuvvnmqz6HYgoAALB9dqqy854tPVsH3HHHHbn77ruvKkVulESv5hyKKQAA\nwPbZqYsRU3flKLn6FHmtSXSSKnAAAMCk2amLEVMZjpKrS5HXmkTn5+dz55135pZbbsnNN9+cW265\nRZU5AADYIltxMWJ1Gs1mpm5Y3aqrSZFbkUTn5+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+uaTvqb4BHASuAh8SrJjYTSPUR6X\ngFWSh35G5jHK4wLwPslLC6PpDfunM3R/5FX6t+NKks/zrkxTO9Scoz9e0Pe5J6M5CJqHeSyHWSyL\neSxHVV2je1muZ5jJpvmYx7KYx3IMl4tdBm6Zxf9r4+JIkqRNDEeH9uZeh5p5LIt5SMticSRJkiRJ\nbNBzJEmSJEnHmcWRJEmSJGFxJEmSJEmAxZEkSZIkARZHkiRJkgRYHEmSJEkSAL8APAm5aPyXJf8A\nAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x112deac18>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "figure(figsize=(14,10))\n",
    "# All points in black.\n",
    "plot_date(time,alt*180./pi,'ko')\n",
    "\n",
    "# Daytime points in yellow.\n",
    "day = alt>0.\n",
    "plot_date(time[day],alt[day]*180./pi,'yo')\n",
    "title(str(utcday))\n",
    "\n",
    "# Improve formatting.\n",
    "axhline(0,color='k',linestyle='--')\n",
    "gcf().autofmt_xdate()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Approximate length of day is: 19.5 hours\n"
     ]
    }
   ],
   "source": [
    "ind = find(day>0.)\n",
    "daylength = float(len(ind))/float(len(time)) * 24.\n",
    "print('Approximate length of day is:', daylength, 'hours')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
